package com.hnkywl.sts.action.xsgl;

import com.google.gson.Gson;
import com.hnkywl.sts.dao.organ.NbgsDao;
import com.hnkywl.sts.dao.xsgl.KcDao;
import com.hnkywl.sts.dao.xsgl.KcbjDao;
import com.hnkywl.sts.entity.base.Sjzdz;
import com.hnkywl.sts.entity.organ.Nbgs;
import com.hnkywl.sts.entity.sys.Gg;
import com.hnkywl.sts.entity.sys.Gncz;
import com.hnkywl.sts.entity.xsgl.Kc;
import com.hnkywl.sts.entity.xsgl.Kcbj;
import com.hnkywl.sts.service.sys.GnczService;
import com.hnkywl.sts.service.sys.YgService;
import com.hnkywl.sts.service.xsgl.KcService;
import com.hnkywl.sts.service.xsgl.KcbjService;
import com.hnkywl.sts.util.POIUtil;
import jxl.Sheet;
import jxl.Workbook;
import net.ruixin.web.struts2.SimpleActionSupport;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.hssf.util.Region;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.hibernate.tool.hbm2x.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 13-4-22
 * Time: 下午3:39
 * To change this template use File | Settings | File Templates.
 */
@Namespace("/xsgl/kcbj")
public class KcbjAction extends SimpleActionSupport {
    private KcbjService kcbjService;
    private KcService kcService;
    private KcDao kcDao;
    private KcbjDao kcbjDao;
    private NbgsDao nbgsDao;
    //库存报价实例
    private Kcbj kcbj;
    private Kc kc;
    //库存报价列表
    private List<Kcbj> kcbjList;
    //库存实例
    private List<Kc> kcList;
    //库存报价Id
    private Long kcbjId;
    //报价日期
    private Date bjrq;
    //报价公司Id
    private Long bjgsId;
    //分页组件 起始位置
    private int page;
    //分页组件 页面大小
    private int rows = 10;
    //公司名称
    private Long bjgsmcId;
    //导入日期
    private Date drqi;
    private File upload;
    //功能操作
    private List<Gncz> gnczList;
    private GnczService gnczService;


    //库存报价导入界面展示
    @Action("kcbj_upload")
    public String kcbjUpload() {
        bjgsId = YgService.getCurrentYgZgGsId();
        drqi = new Date();
        return SUCCESS;
    }

    //库存报价导入
    @Action("kcbj_import")
    public void kcbjImport() {
        try {
            SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd");
            Workbook book = Workbook.getWorkbook(upload);
            //  获得第一个工作表对象
            Sheet sheet = book.getSheet(0);
            String gsId = sheet.getCell(2, 1).getContents(); //第3列，第2行
            String sj = sheet.getCell(4, 1).getContents();
            if (!gsId.equals(bjgsmcId.toString())) {
                renderText("{\"statusCode\":\"300\", \"message\":\"公司选择错误！\"}");
                return;
            }
            if (!sj.equals(dateformat.format(drqi))) {
                renderText("{\"statusCode\":\"300\", \"message\":\"日期选择错误！\"}");
                return;
            }
            //获取总行数
            int rows = sheet.getRows();
            List<Kcbj> kcbjList = new ArrayList<Kcbj>();
            for (int i = 3; i < rows; i++) {
                Gg gg = new Gg();
                gg.setId(Long.parseLong(sheet.getCell(0, i).getContents()));
                Sjzdz cd = new Sjzdz();
                if (StringUtils.isNotEmpty(sheet.getCell(5, i).getContents())) {
                    cd.setId(Long.parseLong(sheet.getCell(5, i).getContents()));
                }
                Nbgs bjgs = new Nbgs();
                bjgs.setId(Long.parseLong(sheet.getCell(2, 1).getContents()));
                Kcbj b = new Kcbj();
                b.setBjgs(bjgs);
                b.setGg(gg);
                if (cd.getId() != null) {
                    b.setCd(cd);
                }
                b.setBjrq(dateformat.parse(sheet.getCell(4, 1).getContents()));
                if (sheet.getCell(9, i) != null && StringUtils.isNotEmpty(sheet.getCell(9, i).getContents())) {
                    b.setBj(Double.parseDouble(sheet.getCell(9, i).getContents()));
                } else {
                    b.setBj(null);
                }
                if (sheet.getCell(10, i) != null && StringUtils.isNotEmpty(sheet.getCell(10, i).getContents())) {
                    b.setScbj(Double.parseDouble(sheet.getCell(10, i).getContents()));
                } else {
                    b.setScbj(null);
                }
                if (sheet.getCell(11, i) != null && StringUtils.isNotEmpty(sheet.getCell(11, i).getContents())) {
                    b.setWj(Double.parseDouble(sheet.getCell(11, i).getContents()));
                } else {
                    b.setWj(null);
                }
                kcbjList.add(b);
            }
            this.kcbjService.saveKcbj(kcbjList, Long.parseLong(sheet.getCell(2, 1).getContents()));
            renderText("{\"statusCode\":\"200\", \"message\":\"保存成功！\"}");
        } catch (Exception e) {
            e.printStackTrace();
            renderText("{\"statusCode\":\"300\", \"message\":\"" + e.getMessage() + "\"}");
        }
    }

    //库存报价导出
    @Action("kcbj_export")
    public String kcbjExport() {
        SimpleDateFormat dateformat2 = new SimpleDateFormat("yyyy-MM-dd");
        List<Map> kcbjList1 = kcDao.findKcList(bjgsId, bjrq);
        //第一步，创建一个webbook，对应一个Excel文件
        HSSFWorkbook wb = new HSSFWorkbook();
        //第二步，在webbook中添加一个sheet,对应Excel文件中的sheet
        HSSFSheet sheet = wb.createSheet("sheet1");
        POIUtil poiUtil = new POIUtil(wb);
        //设置列宽
        sheet.setDefaultRowHeightInPoints(15);
        sheet.setDefaultColumnWidth((short) 12);
        sheet.setColumnWidth((short) 0, (short) (8 * 512));
        sheet.setColumnWidth((short) 1, (short) (8 * 512));
        sheet.setColumnWidth((short) 2, (short) (8 * 512));
        sheet.setColumnWidth((short) 3, (short) (8 * 512));
        sheet.setColumnWidth((short) 4, (short) (8 * 512));
        sheet.setColumnWidth((short) 5, (short) (8 * 512));
        sheet.setColumnWidth((short) 6, (short) (8 * 512));
        sheet.setColumnWidth((short) 7, (short) (8 * 512));
        sheet.setColumnWidth((short) 8, (short) (8 * 512));
        sheet.setColumnWidth((short) 9, (short) (8 * 512));
        sheet.setColumnWidth((short) 10, (short) (8 * 512));
        sheet.setColumnWidth((short) 11, (short) (8 * 512));
        //第三步，在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制short
        HSSFRow row = sheet.createRow((int) 0);
        row.setHeightInPoints(36);
        //第四步，创建单元格，并设置值表头  设置表头居中
        HSSFCellStyle titleStyle = poiUtil.createTitleHSSFCellStyle(wb);
        HSSFCell titleCell = row.createCell((short) 0);
        titleCell.setCellStyle(titleStyle);
        titleCell.setEncoding(HSSFCell.ENCODING_UTF_16);
        titleCell.setCellValue("库存报价导出汇总表");
        sheet.addMergedRegion(new Region(0, (short) 0, 0, (short) 11));
        row = sheet.createRow((int) 1);
        row.setHeightInPoints(21);
        HSSFCell deptCellName = row.createCell((short) 0);
        deptCellName.setCellStyle(poiUtil.createMonthHSSFCellStyle(wb));
        deptCellName.setEncoding(HSSFCell.ENCODING_UTF_16);
        deptCellName.setCellValue("单位名称:");
        HSSFCell dept = row.createCell((short) 1);
        dept.setCellStyle(poiUtil.createMonthHSSFCellStyle(wb));
        dept.setEncoding(HSSFCell.ENCODING_UTF_16);
        dept.setCellValue(nbgsDao.get(bjgsId).getQc());
        HSSFCell deptName = row.createCell((short) 2);
        deptName.setCellStyle(poiUtil.createMonthHSSFCellStyle(wb));
        deptName.setEncoding(HSSFCell.ENCODING_UTF_16);
        deptName.setCellValue(bjgsId);
        HSSFCell deptCell = row.createCell((short) 3);
        deptCell.setCellStyle(poiUtil.createMonthHSSFCellStyle(wb));
        deptCell.setEncoding(HSSFCell.ENCODING_UTF_16);
        deptCell.setCellValue("报价日期:");
        HSSFCell dqrq = row.createCell((short) 4);
        dqrq.setCellStyle(poiUtil.createMonthHSSFCellStyle(wb));
        dqrq.setEncoding(HSSFCell.ENCODING_UTF_16);
        dqrq.setCellValue(dateformat2.format(bjrq));
        //生成第一行数据...表头
        HSSFCellStyle headerStyle = poiUtil.createHeader3HSSFCellStyle(wb);
        poiUtil.fillRow(sheet, headerStyle, 2, "物资ID", "物资名称", "物资材质", "物资规格", "单位", "产地ID", "产地", "库存数量", "可开单数量",
                "报价", "市场报价", "网价");
        //表体部分
        for (int i = 3; i < kcbjList1.size() + 3; i++) {
            Map item = kcbjList1.get(i - 3);
            poiUtil.fillRow(sheet, null, i, item.get("gg.id"), item.get("gg.name"), item.get("gg.cz"), item.get("gg.ggxh"), item.get("gg.dw"), item.get("cd.id"),
                    item.get("cd.z"), item.get("kcsl"), item.get("kkdsl"), item.get("bj"), item.get("scbj"), item.get("wj"));
        }
        try {
            response.setContentType("application/x-download");
            String filedisplay = new String((dateformat2.format(bjrq) + "库存报价汇总表.xls").getBytes("gb2312"), "iso8859-1");
            response.addHeader("Content-Disposition", "attachment;filename=" + filedisplay);
            wb.write(response.getOutputStream());
            response.getOutputStream().close();
        } catch (Exception e) {
            e.printStackTrace();
            renderText("位置异常，导出失败" + e.getMessage());
        }
        return null;
    }

    //核对库存报价导入界面展示
    @Action("hdbj_upload")
    public String hdbjUpload() {
        bjgsId = YgService.getCurrentYgZgGsId();
        drqi = new Date();
        return SUCCESS;
    }

    //核对库存报价导入
    @Action("hdbj_import")
    public void hdbjImport() {
        try {
            SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd");
            Workbook book = Workbook.getWorkbook(upload);
            //  获得第一个工作表对象
            Sheet sheet = book.getSheet(0);
            String gsId = sheet.getCell(2, 1).getContents();
            String sj = sheet.getCell(4, 1).getContents();
            if (!gsId.equals(bjgsmcId.toString())) {
                renderText("{\"statusCode\":\"300\", \"message\":\"公司选择错误！\"}");
                return;
            }
            if (!sj.equals(dateformat.format(drqi))) {
                renderText("{\"statusCode\":\"300\", \"message\":\"日期选择错误！\"}");
                return;
            }
            //获取总行数
            int rows = sheet.getRows();
            List<Kcbj> kcbjList = new ArrayList<Kcbj>();
            for (int i = 3; i < rows; i++) {
                Kcbj b = kcbjService.findKcbjDetail(Long.parseLong(sheet.getCell(15, i).getContents()));
                if (sheet.getCell(10, i) != null && StringUtils.isNotEmpty(sheet.getCell(10, i).getContents())) {
                    b.setHdbj(Double.parseDouble(sheet.getCell(10, i).getContents()));
                } else {
                    b.setHdbj(null);
                }
                if (sheet.getCell(12, i) != null && StringUtils.isNotEmpty(sheet.getCell(12, i).getContents())) {
                    b.setHdscbj(Double.parseDouble(sheet.getCell(12, i).getContents()));
                } else {
                    b.setHdscbj(null);
                }
                if (sheet.getCell(14, i) != null && StringUtils.isNotEmpty(sheet.getCell(14, i).getContents())) {
                    b.setHdwj(Double.parseDouble(sheet.getCell(14, i).getContents()));
                } else {
                    b.setHdwj(null);
                }
                kcbjList.add(b);
            }
            this.kcbjService.saveHdkcbj(kcbjList);
            renderText("{\"statusCode\":\"200\", \"message\":\"保存成功！\"}");
        } catch (Exception e) {
            e.printStackTrace();
            renderText("{\"statusCode\":\"300\", \"message\":\"" + e.getMessage() + "\"}");
        }
    }

    //核对库存报价导出
    @Action("hdbj_export")
    public String hdbjExport() {
        SimpleDateFormat dateformat2 = new SimpleDateFormat("yyyy-MM-dd");
        List<Map> kcbjList2 = kcbjDao.findKcbjList(bjgsId, bjrq);
        //第一步，创建一个webbook，对应一个Excel文件
        HSSFWorkbook wb = new HSSFWorkbook();
        //第二步，在webbook中添加一个sheet,对应Excel文件中的sheet
        HSSFSheet sheet = wb.createSheet("sheet");
        POIUtil poiUtil = new POIUtil(wb);
        //设置列宽
        sheet.setDefaultRowHeightInPoints(15);
        sheet.setDefaultColumnWidth((short) 16);
        sheet.setColumnWidth((short) 0, (short) (8 * 512));
        sheet.setColumnWidth((short) 1, (short) (8 * 512));
        sheet.setColumnWidth((short) 2, (short) (8 * 512));
        sheet.setColumnWidth((short) 3, (short) (8 * 512));
        sheet.setColumnWidth((short) 4, (short) (8 * 512));
        sheet.setColumnWidth((short) 5, (short) (8 * 512));
        sheet.setColumnWidth((short) 6, (short) (8 * 512));
        sheet.setColumnWidth((short) 7, (short) (8 * 512));
        sheet.setColumnWidth((short) 8, (short) (8 * 512));
        sheet.setColumnWidth((short) 9, (short) (8 * 512));
        sheet.setColumnWidth((short) 10, (short) (8 * 512));
        sheet.setColumnWidth((short) 11, (short) (8 * 512));
        sheet.setColumnWidth((short) 12, (short) (8 * 512));
        sheet.setColumnWidth((short) 13, (short) (8 * 512));
        sheet.setColumnWidth((short) 14, (short) (8 * 512));
        sheet.setColumnWidth((short) 15, (short) (8 * 512));
        //第三步，在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制short
        HSSFRow row = sheet.createRow((int) 0);
        row.setHeightInPoints(36);
        //第四步，创建单元格，并设置值表头  设置表头居中
        HSSFCellStyle titleStyle = poiUtil.createTitleHSSFCellStyle(wb);
        HSSFCell titleCell = row.createCell((short) 0);
        titleCell.setCellStyle(titleStyle);
        titleCell.setEncoding(HSSFCell.ENCODING_UTF_16);
        titleCell.setCellValue("核对库存报价导出汇总表");
        sheet.addMergedRegion(new Region(0, (short) 0, 0, (short) 15));
        row = sheet.createRow((int) 1);
        row.setHeightInPoints(21);
        HSSFCell deptCellName = row.createCell((short) 0);
        deptCellName.setCellStyle(poiUtil.createMonthHSSFCellStyle(wb));
        deptCellName.setEncoding(HSSFCell.ENCODING_UTF_16);
        deptCellName.setCellValue("单位名称:");
        HSSFCell dept = row.createCell((short) 1);
        dept.setCellStyle(poiUtil.createMonthHSSFCellStyle(wb));
        dept.setEncoding(HSSFCell.ENCODING_UTF_16);
        dept.setCellValue(nbgsDao.get(bjgsId).getQc());
        HSSFCell deptName = row.createCell((short) 2);
        deptName.setCellStyle(poiUtil.createMonthHSSFCellStyle(wb));
        deptName.setEncoding(HSSFCell.ENCODING_UTF_16);
        deptName.setCellValue(bjgsId);
        HSSFCell deptCell = row.createCell((short) 3);
        deptCell.setCellStyle(poiUtil.createMonthHSSFCellStyle(wb));
        deptCell.setEncoding(HSSFCell.ENCODING_UTF_16);
        deptCell.setCellValue("报价日期:");
        HSSFCell dqrq = row.createCell((short) 4);
        dqrq.setCellStyle(poiUtil.createMonthHSSFCellStyle(wb));
        dqrq.setEncoding(HSSFCell.ENCODING_UTF_16);
        dqrq.setCellValue(dateformat2.format(bjrq));
        //生成第一行数据
        HSSFCellStyle headerStyle = poiUtil.createHeader3HSSFCellStyle(wb);
        poiUtil.fillRow(sheet, headerStyle, 2, "物资ID", "物资名称", "物资材质", "物资规格", "单位", "产地ID", "产地", "库存数量", "可开单数量",
                "报价", "核对报价", "市场报价", "核对市场报价", "网价", "核对网价", "库存报价ID");
        //表体部分
        for (int i = 3; i < kcbjList2.size() + 3; i++) {
            Map item = kcbjList2.get(i - 3);
            poiUtil.fillRow(sheet, null, i, item.get("gg.id"), item.get("gg.name"), item.get("gg.cz"), item.get("gg.ggxh"), item.get("gg.dw"), item.get("cd.id"),
                    item.get("cd.z"), item.get("kcsl"), item.get("kkdsl"), item.get("bj"), item.get("hdbj"),
                    item.get("scbj"), item.get("hdscbj"), item.get("wj"), item.get("hdwj"), item.get("id"));
        }
        try {
            //设置生成的文件类型
            response.setContentType("application/x-download");
            String filedisplay = new String((dateformat2.format(bjrq) + "核对库存报价汇总表.xls").getBytes("gb2312"), "iso8859-1");
            //设置文件头编码方式和文件名
            response.addHeader("Content-Disposition", "attachment;filename=" + filedisplay);
            wb.write(response.getOutputStream());
            response.getOutputStream().close();
        } catch (Exception e) {
            e.printStackTrace();
            renderText("位置异常，导出失败" + e.getMessage());
        }
        return null;
    }

    @Action("kcbj")
    public String kcbj() {
        if (bjgsId == null)
            bjgsId = YgService.getCurrentYgZgGsId();
        if (bjrq == null)
            bjrq = new Date();
        gnczList = gnczService.findGnczByJsAndUrl(request.getServletPath());
        return SUCCESS;
    }

    //库存报价的查询分页显示
    @Action("kcbjList")
    public void kcbjList() {
        if (bjgsId == null)
            bjgsId = YgService.getCurrentYgZgGsId();
        this.renderJson(this.kcbjService.findKcbjList(bjrq, bjgsId, page, rows));
    }

    //库存报价的审批列表，默认核定报价默认与报价相同
    @Action("kcbjList_sp")
    public void kcbjListSp() {
        if (bjgsId == null)
            bjgsId = YgService.getCurrentYgZgGsId();
        this.renderJson(this.kcbjService.findKcbjListSp(bjrq, bjgsId, page, rows));
    }

    //库存的查询
    @Action("kcList")
    public void kcList() {
        if (bjgsId == null)
            bjgsId = YgService.getCurrentYgZgGsId();
        this.renderJson(this.kcService.findAllKc(bjgsId, bjrq));
    }

    //库存管理页面列表
    @Action("kcglList")
    public void kcglList() {
        if (bjgsId == null)
            bjgsId = YgService.getCurrentYgZgGsId();
        this.renderJson(this.kcService.findAllKcgl(bjgsId));
    }

    @Action("kcbj_content")
    public String kcbjContent() {
        if (bjrq == null)
            bjrq = new Date();
        if (bjgsId == null)
            bjgsId = YgService.getCurrentYgZgGsId();
//        kcService.kcSync(bjgsId);
        return SUCCESS;
    }

    @Action("hdbj_content")
    public String hdbjContent() {
        if (bjrq == null)
            bjrq = new Date();
        if (bjgsId == null)
            bjgsId = YgService.getCurrentYgZgGsId();
        return SUCCESS;
    }

    @Action("kcgl_content")
    public String kcglContent() {
        if (bjgsId == null)
            bjgsId = YgService.getCurrentYgZgGsId();
//        kcService.kcSync(bjgsId);
        return SUCCESS;
    }

    @Action("scKc")
    public void scKc() {
        if (bjgsId == null)
            bjgsId = YgService.getCurrentYgZgGsId();
        try {
            kcService.scKc(bjgsId);
            renderText("{\"statusCode\":\"200\", \"message\":\"操作成功！\"}");
        } catch (Exception e) {
            e.printStackTrace();
            renderText("{\"statusCode\":\"300\", \"message\":\"" + e.getMessage() + "\"}");
        }
    }

    /**
     * 保存库存
     */
    @Action("save_kc")
    public void saveKc() {
        try {
            this.kcService.saveKc(kcList);
            renderText("{\"statusCode\":\"200\", \"message\":\"保存成功！\"}");
        } catch (Exception e) {
            e.printStackTrace();
            renderText("{\"statusCode\":\"300\", \"message\":\"" + e.getMessage() + "\"}");
        }
    }

    /**
     * 删除库存
     */
    @Action("delete_kc")
    public void deleteKc() {
        try {
            this.kcService.deleteKc(kc);
            renderText("{\"statusCode\":\"200\", \"message\":\"删除成功！\"}");
        } catch (Exception e) {
            e.printStackTrace();
            renderText("{\"statusCode\":\"300\", \"message\":\"" + e.getMessage() + "\"}");
        }
    }

    /**
     * 保存库存报价
     */
    @Action("save_kcbj")
    public void saveKcbj() {
        try {
            this.kcbjService.saveKcbj(kcbjList, bjgsId);
            renderText("{\"statusCode\":\"200\", \"message\":\"保存成功！\"}");
        } catch (Exception e) {
            e.printStackTrace();
            renderText("{\"statusCode\":\"300\", \"message\":\"" + e.getMessage() + "\"}");
        }
    }

    /**
     * 保存核对库存报价
     */
    @Action("save_hdkcbj")
    public void saveHdkcbj() {
        try {
            this.kcbjService.saveHdkcbj(kcbjList);
            renderText("{\"statusCode\":\"200\", \"message\":\"保存成功！\"}");
        } catch (Exception e) {
            e.printStackTrace();
            renderText("{\"statusCode\":\"300\", \"message\":\"" + e.getMessage() + "\"}");
        }
    }


    //================getter and setter ============
    public Kcbj getKcbj() {
        return kcbj;
    }

    public void setKcbj(Kcbj kcbj) {
        this.kcbj = kcbj;
    }

    public Long getKcbjId() {
        return kcbjId;
    }

    public void setKcbjId(Long kcbjId) {
        this.kcbjId = kcbjId;
    }

    public Date getBjrq() {
        return bjrq;
    }

    public void setBjrq(Date bjrq) {
        this.bjrq = bjrq;
    }

    public Long getBjgsId() {
        return bjgsId;
    }

    public void setBjgsId(Long bjgsId) {
        this.bjgsId = bjgsId;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getRows() {
        return rows;
    }

    public void setRows(int rows) {
        this.rows = rows;
    }

    public List<Kc> getKcList() {
        return kcList;
    }

    public void setKcList(List<Kc> kcList) {
        this.kcList = kcList;
    }

    public List<Kcbj> getKcbjList() {
        return kcbjList;
    }

    public void setKcbjList(List<Kcbj> kcbjList) {
        this.kcbjList = kcbjList;
    }

    public Kc getKc() {
        return kc;
    }

    public void setKc(Kc kc) {
        this.kc = kc;
    }

    public Long getBjgsmcId() {
        return bjgsmcId;
    }

    public void setBjgsmcId(Long bjgsmcId) {
        this.bjgsmcId = bjgsmcId;
    }

    public Date getDrqi() {
        return drqi;
    }

    public void setDrqi(Date drqi) {
        this.drqi = drqi;
    }

    public File getUpload() {
        return upload;
    }

    public void setUpload(File upload) {
        this.upload = upload;
    }

    public List<Gncz> getGnczList() {
        return gnczList;
    }

    public void setGnczList(List<Gncz> gnczList) {
        this.gnczList = gnczList;
    }

    @Autowired
    public void setKcbjService(KcbjService kcbjService) {
        this.kcbjService = kcbjService;
    }

    @Autowired
    public void setKcService(KcService kcService) {
        this.kcService = kcService;
    }

    @Autowired
    public void setNbgsDao(NbgsDao nbgsDao) {
        this.nbgsDao = nbgsDao;
    }

    @Autowired
    public void setGnczService(GnczService gnczService) {
        this.gnczService = gnczService;
    }

    @Autowired
    public void setKcDao(KcDao kcDao) {
        this.kcDao = kcDao;
    }

    @Autowired
    public void setKcbjDao(KcbjDao kcbjDao) {
        this.kcbjDao = kcbjDao;
    }
}
